home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part1 / 670 < prev    next >
Encoding:
Text File  |  1996-08-06  |  1.0 KB  |  23 lines

  1. Newsgroups: comp.lang.c++
  2. Path: news3.noc.netcom.net!zdc!zippo!usenet
  3. From: Oliver.Schaedlich@launchpad.unc.edu
  4. Subject: Constructor Exceptions
  5. Sender: usenet@news.zippo.com
  6. Nntp-Posting-Host: sunserver1.rz.uni-duesseldorf.de
  7. Organization: Zippo
  8. Message-ID: <DKpyu6.315@news.zippo.com>
  9. Date: Fri, 5 Jan 1996 17:49:18 GMT
  10.  
  11.   Hi!
  12.  
  13. I've had the same problem with throwing exceptions from a constructor until
  14. Visual C++ 4.0 (<= 2.2 doesn't free mem.). The documentation on VC++ 4.0
  15. says that the memory occupied by an new-ed object isn't freed when throwing
  16. an exception. Because VC++ 4.0 *does* free the memory I think Microsoft
  17. missed to correct or even delete this part of the documentation.
  18. Microsoft's new behaviour is correct according to the ANSI C++ draft and
  19. Watcom 10.5 is also ok. So if you don't have VC++ 4.0 yet use exceptions
  20. in your constructors and compinal the final code when you have VC++ 4.0.
  21. There are some compilers which have this bug and others don't. F.e. sun's
  22. c++ implementation is not ok and the Gnu implementation is ok.
  23.